﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AddIn.EA.Framework;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace AddIn.EA.Architecture.ComponentLogic.StandardProject
{
    [Serializable()]
    public class PropertyStandardProject : Property, ISerializable
    {
        /// <summary>
        /// Used to identity a unique property
        /// </summary>
        public Int32 Sequence { get; set; }

        [XmlElement("Scope")]
        public ElementScope Scope { get; set; }
        [XmlElement("Stereotype")]
        public String Stereotype { get; set; }
        [XmlElement("InitialValue")]
        public String InitialValue { get; set; }
        [XmlElement("IsStatic")]
        public Boolean IsStatic { get; set; }
        [XmlElement("IsConstant")]
        public Boolean IsConstant { get; set; }
        [XmlElement("Encapsulate")]
        public Boolean Encapsulate { get; set; }

        public override void Update(AddIn.EA.Framework.Element parentElement)
        {
            AttributeClass attrib = CreateAttribute(parentElement);
            if (Encapsulate)
                CreateAttributeProperty(attrib);
        }

        #region ISerializable Members

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
